<!DOCTYPE html>
<title>Tests that animation works, if changing begin to contain an event-base trigger.</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<svg>
    <rect id="rect" width="100" height="100">
        <set id="anim"
            begin="indefinite"
            dur="0.05s"
            attributeName="width"
            to="50"
            fill="freeze"/>
    </rect>
</svg>
<script>
    var anim = document.getElementById("anim");
    var t = async_test(document.title);
    anim.onbegin = t.step_func_done(function() {
        assert_equals(anim.targetElement.getBBox().width, 50);
    });

    anim.setAttribute("begin","rect.click");
    if (window.eventSender) {
        eventSender.mouseMoveTo(50, 50);
        eventSender.mouseDown();
        eventSender.mouseUp();
    }
</script>
